#ifndef _VOLUME_ENGINE_CORE_INTERFACE_H
#define _VOLUME_ENGINE_CORE_INTERFACE_H

#include "engineCoreType.h"

class volumeManager;

////////////////////////////All the parameters//////////////////////////////////////
typedef struct 
{
	//phong shading parameter
	float shininess;
	float diffuse;
	float specular;
	float lightPosition[4];
	//volume rendering
	float isoValue;
	float stepsize;
	float clippingX, clippingY, clippingZ;
	int tranferFunctionType;
} parameterShading;

typedef struct 
{
	//viewing matrix
	float* rotateMatrix;//16
	float* posVec;//3
	float* viewProjMatrix;//16
	//view position
	//double *eyePosition; //4
} parameterViewing;
//////////////////////////////////////////////////////////////////////////////////////////////
//loadSingleVolume
//standard volume raycasting
//loadInitalBlockPool
//loadNodePool
//multiRes octreeVolume raycasting


//public function start with uppercase
class volumeEngineCoreInterface
{
public:

	virtual void destroyObject() = 0;
	virtual bool InitEngine(int w, int h) = 0;//setup render buffer, create all shader prog, TF, 
	
	virtual void Render() = 0;
	virtual void RenderToImage() = 0;
	
	virtual void Resize(int w, int h) = 0;
	virtual void Refresh() = 0; // reload shader etc.

	virtual void Init1DTF(int dataSize, int tableSize) = 0; //elementSize  = dataSize / tableSize
	virtual void Update1DTF(void* buffer) = 0;

	//this is virtual due to the difference between OpenGL and DirectX coordinate system
	virtual void SetViewingParameters(parameterViewing &paraV) = 0; 
	virtual void SetShadingParameters(parameterShading &paraS) = 0;
	virtual bool LoadCoreStatusFromFile(const char* filename) = 0;
	virtual bool SaveCoreStatusToFile(const char* filename) = 0;

	virtual bool loadSingleVolume(const char* filename) = 0;

//public:
	//Set rendering status
	//parameterShading& GetShadingParameters();

	//void SetVolumeMan(volumeManager *volMan);

	//use boost serialization?
protected:
	virtual ~volumeEngineCoreInterface() = 0;

protected:
	int _width, _height; //viewport size
	parameterShading _paraS;
	parameterViewing _paraV;
	volumeManager *_volMan;


};

#endif